﻿@namespace Masa.Tsc.Web.Admin.Rcl.Pages.Apm
@inherits ApmComponentBase
@page "/apm/endpoints/{name}"
<PageTitle>@I18n.Apm("PageTitles.EndpointDetail")</PageTitle>

<ApmSearchComponent Value="Search"
                    ValueChanged="OnSearchValueChanged"
                    IsEndpoint
                    ShowComparison @ref="ApmSearchComponent" />

<MTabs @bind-Value="index" Class="rounded-t-xl">
    <MTab Value="1">@I18n.Apm("Tabs.Overview")</MTab>
    <MTab Value="2">@I18n.Apm("Tabs.Errors")</MTab>
    <MTab Value="3">@I18n.Apm("Tabs.Logs")</MTab>
    <div class="d-flex justify-end" style="width:calc(100% - 300px)">
        <div class="pr-4 pt-4" style="color:#BDBDBD">@GetService(Search.Service!)?.AppDescription</div>
    </div>
</MTabs>
<CascadingValue Value="Search">
    <div style="height:calc(100vh - 280px)" class="overflow-y-scroll">
        <MTabsItems @bind-Value="index" Class="rounded-b-xl">
            <MTabItem Value="1">
                <Masa.Tsc.Web.Admin.Rcl.Pages.Apm.Endpoints.OverView OnSpanIdChanged="SpanIdChange" />
            </MTabItem>
            <MTabItem Value="2">
                <Masa.Tsc.Web.Admin.Rcl.Pages.Apm.Services.ServiceErrors SpanId="@spanId" />
            </MTabItem>
            <MTabItem Value="3">
                <Masa.Tsc.Web.Admin.Rcl.Pages.Apm.Services.ServiceLogs ShowChart=false SpanId="@spanId" />
            </MTabItem>
        </MTabsItems>
    </div>
</CascadingValue>